package com.lqq.entity;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

@JsonIgnoreProperties(value = {"handler"})
public class Employee implements Serializable{
    private Integer id;

    @Pattern(regexp = "^([a-z0-9_-]{6,16})|([\\u2E80-\\u9FFF]+)$",message = "用户名必须由6-16位字母和数组组合或中文")
    private String name;

    private String sex;

    @NotNull(message = "年龄不能为空!")
    private Integer age;

    private Integer deptId;

    private Dept dept;

    public void setDept(Dept dept) {
        this.dept = dept;
    }

    public Dept getDept() {

        return dept;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex == null ? null : sex.trim();
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Integer getDeptId() {
        return deptId;
    }

    public void setDeptId(Integer deptId) {
        this.deptId = deptId;
    }

    public Employee() {
    }

    public Employee(Integer id, String name, String sex, Integer age, Integer deptId) {

        this.id = id;
        this.name = name;
        this.sex = sex;
        this.age = age;
        this.deptId = deptId;
    }
}